cmake_minimum_required(VERSION 3.15)

include(proj.conf)

find_package(bouffalo_sdk REQUIRED HINTS $ENV{BL_SDK_BASE})
file(GLOB_RECURSE modbus "${CMAKE_CURRENT_SOURCE_DIR}/app/*.c")
file(GLOB_RECURSE paho_mqtt "${CMAKE_CURRENT_SOURCE_DIR}/paho_mqtt/src/*.c")
file(GLOB_RECURSE wifi "${CMAKE_CURRENT_SOURCE_DIR}/wifi/*.c")
# file(GLOB_RECURSE cjson "${CMAKE_CURRENT_SOURCE_DIR}/cjson/src/*.c")
sdk_add_include_directories(.)
sdk_add_include_directories(tjpgd1d/include)
sdk_add_include_directories(app)
sdk_add_include_directories(paho_mqtt/inc)
sdk_add_include_directories(wifi)
# sdk_add_include_directories(cjson/inc)

target_sources(app PRIVATE ${modbus})
target_sources(app PRIVATE ${paho_mqtt})
target_sources(app PRIVATE ${wifi})
# target_sources(app PRIVATE ${cjson})
target_sources(app PRIVATE

    LoraBoard.c
)

# file(GLOB_RECURSE ligjepg "${CMAKE_CURRENT_SOURCE_DIR}/libjepg/src/*.c")
# sdk_add_include_directories(libjepg/inc)
# target_sources(app PRIVATE ${ligjepg})

# User
sdk_add_compile_definitions(-DCONFIG_CLI_CMD_ENABLE)
#sdk_add_compile_definitions(-DBL616_DHCP_DEBUG)
# sdk_add_compile_definitions(-DSIMU_DATA_TEST)
# sdk_add_compile_definitions(-DCONFIG_IRQ_USE_VECTOR)

# run in psram, need boot2 and psram-ld
# sdk_add_compile_definitions(-DCONFIG_PSRAM_COPY_CODE)

# add_subdirectory(${BL_SDK_BASE}/examples/solutions/solution_utils solution_utils)

# psram ld (support DBI-typeB x8)
# sdk_set_linker_script(m61_evb_s1/bl616_psram.ld)

# psram uvc ld (support DBI-typeB x8 and uvc)
# sdk_set_linker_script(m61_evb_s1/bl616_psram_uvc.ld)

# flash ld 
# sdk_set_linker_script(m61_evb_s1/bl616_flash.ld)

# flash ld (support uvc)
sdk_set_linker_script(m61_evb_s1/bl616_flash_uvc.ld)

sdk_set_main_file(main.c)

project(image_trans_aithinker)
